#ifndef YATUN_CLIENT_H
#define YATUN_CLIENT_H

#include "Yatun.h"
#include "ConfigParser.h"
#include "c_Plug_IO.h"
#include "IO_Tun.h"
#include "IO_UDP.h"
#include "IO_TCP.h"


#include <sys/socket.h> 
#include <netinet/in.h> 
#include <arpa/inet.h> 



struct YatunClientConf {
    char *SessionName;
    char *mServerAddress;
    int mServerPort;
    int UseMServer;
    int Port;
};

class YatunClient {
private:
    char *SessionName;
    char *mServerAddress;
    int mServerPort;
    ConfigParser *Config;
    YatunTunnel *Tunnel;

    c_Plug_IO* Negotiate(c_Plug_IO *,struct YatunTunnelConf &);
    int NegotiateMServer(c_Plug_IO *IORemote);

    
public:
    YatunClient(ConfigParser *);
    ~YatunClient();

    int SetConf(struct YatunClientConf &);
};

#endif
